package com.leadingsoft.pwxk.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.pwxk.dto.SearchDto;
import com.leadingsoft.pwxk.enums.EDrainCountType;
import com.leadingsoft.pwxk.service.DrainCountService;
import com.leadingsoft.pwxk.service.PwxkGisService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 排污许可GIS
 * 
 * @author Administrator
 *
 */
@Api(description = "排污许可GIS")
@RestController
@RequestMapping("api/gis")
public class PwxkGisController {
	@Autowired
	private PwxkGisService pwxkGisService;
	@Autowired
	private DrainCountService drainCountService;

	@ApiOperation("排污许可证企业")
	@GetMapping("/pwxkEnterprise")
	@ResponseStatus(code = HttpStatus.OK)
	public List<Map<String, Object>> getPwxkList(SearchDto search) {
		return pwxkGisService.getPwxkList(search);
	}

	@ApiOperation("排污许可证")
	@GetMapping("license")
	@ResponseStatus(code = HttpStatus.OK)
	public List<Map<String, Object>> getlicenseStatiscal(SearchDto search) {
		return pwxkGisService.getLicenseStatiscal(search);
	}

	@ApiOperation("大气污染物排放量")
	@GetMapping("gas")
	@ResponseStatus(code = HttpStatus.OK)
	public List<Map<String, Object>> getGasStatiscal(SearchDto search) {
		return pwxkGisService.getGisStatiscal(search);
	}

	@ApiOperation("水污染物排放量")
	@GetMapping("water")
	@ResponseStatus(code = HttpStatus.OK)
	public List<Map<String, Object>> getWaterStatiscal(SearchDto search) {
		return pwxkGisService.getWaterStatiscal(search);
	}

	@ApiOperation("排放口(地图)")
	@GetMapping("DrainCountMap")
	List<Map<String, Object>> DrainCountMap(SearchDto searchDto,
			@RequestParam(value = "eGroup", defaultValue = "airCount") EDrainCountType eGroup) {
		return drainCountService.DrainCountMap(searchDto, eGroup);
	}

}
